package com.lobo.blog.mappers;

import com.lobo.blog.entity.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @authoer:MacieSerenity
 * @createDate: 2022/10/4
 * @description:
 */
@Mapper
public interface AdminBlogMapper {

    Blog getBlogById(@Param("blogId") int blogId);

    List<Blog> getAllBlogByList();

    List<Blog> getAllBlogByCondition(@Param("blog") Blog blog);

    List<Blog> getAllPublishedBlogByList();

    Blog findSameTitleBlog(@Param("title") String title);

    int updateBlogById(@Param("blogId") int blogId, @Param("blog") Blog blog);

    int deleteBlog(@Param("blogId") int blogId);

    int unDeletedBlog(@Param("blogId") int blogId);

    int saveBlog(@Param("blog") Blog blog);

    int saveTag(@Param("blogId") Integer blogId, @Param("tagsId") String[] tagsId);

    int deleteBlogTags(@Param("blogId") Integer blogId);
}
